Skip to content

[AI-FSSDK] (DO NOT REVIEW) [FSSDK-12262] Exclude CMAB from UserProfileService#12

Closed
jaeopt wants to merge 1 commit intomasterfrom
ai/jaeopt/FSSDK-12262-cmab-ups
Closed

[AI-FSSDK] (DO NOT REVIEW) [FSSDK-12262] Exclude CMAB from UserProfileService#12
jaeopt wants to merge 1 commit intomasterfrom
ai/jaeopt/FSSDK-12262-cmab-ups

Conversation

@jaeopt
Copy link
Owner

@jaeopt jaeopt commented Feb 5, 2026

Summary

Excludes CMAB (Contextual Multi-Armed Bandit) experiments from User Profile Service (UPS) sticky bucketing logic.

Jira Ticket: FSSDK-12262

Problem

CMAB experiments require dynamic decisions based on current user attributes and TTL, which contradicts UPS's behavior of maintaining decisions across the experiment lifetime without considering these factors.

Solution

Modified decision_service.py to exclude CMAB experiments from UPS logic:

  • Skip reading stored variations for CMAB experiments (line 460)
  • Skip writing new variations to UPS for CMAB experiments (line 533)

Changes Made

  • optimizely/decision_service.py: Added and not experiment.cmab condition to both UPS read and write checks
  • tests/test_decision_service.py: Added test_get_variation_cmab_experiment_excludes_user_profile_service to verify exclusion

Quality Assurance

Test Results:

  • ✅ All tests passing: 28/28 (100%)
  • ✅ New test verifies CMAB exclusion from UPS
  • ✅ All existing CMAB tests pass (6/6)
  • ✅ No regressions detected

Code Review:

  • ✅ Minimal, focused changes
  • ✅ Clear inline comments explaining the exclusion
  • ✅ Both read and write paths properly excluded
  • ✅ Backward compatibility maintained

Test Plan

  1. Run all DecisionServiceTest tests: pytest tests/test_decision_service.py::DecisionServiceTest
  2. Run CMAB-specific tests: pytest tests/test_decision_service.py -k cmab
  3. Verify new test: pytest tests/test_decision_service.py::DecisionServiceTest::test_get_variation_cmab_experiment_excludes_user_profile_service

🤖 Generated with Claude Code

Exclude CMAB experiments from User Profile Service (UPS) sticky bucketing logic.
CMAB experiments require dynamic decisions based on current user attributes and TTL,
which contradicts UPS's behavior of maintaining decisions across experiment lifetime.

Changes:
- Modified decision_service.py to skip UPS read/write for CMAB experiments
- Added test to verify CMAB experiments don't use UPS
- All existing tests pass (28/28)

Quality Assurance:
- Tests Passed: 28/28 (100%)
- New test: test_get_variation_cmab_experiment_excludes_user_profile_service
- Code review: No issues found
- Backward compatibility: Confirmed

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@jaeopt jaeopt closed this Feb 5, 2026
@jaeopt jaeopt deleted the ai/jaeopt/FSSDK-12262-cmab-ups branch February 5, 2026 00:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant